<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>图片上传</title>
    <link rel="stylesheet" href="__ROOT__/public/demo/css/tinyImgUpload.css">
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
    <div id="upload">
    <!-- 添加区域-->
    </div>
    <button class="submit">submit</button>
</form>
    <script src="__ROOT__/public/demo/js/tinyImgUpload.js"></script>
    <script>

        window.onload=function(){
                function zoom() {
                         var html = document.querySelector("html");
                         var rem = html.offsetWidth / 3.75;
                        document.documentElement.style.fontSize = rem + "px";
                    }
                    zoom();
                    window.onresize = zoom;
            }
        //document.documentElement.style.fontSize = document.documentElement.clientWidth*0.1+'px';

        var options = {
            path: '/',
            onSuccess: function (res) {
                console.log(res);
            },
            onFailure: function (res) {
                console.log(res);
            }
        }
        var upload = tinyImgUpload('#upload', options);
        document.getElementsByClassName('submit')[0].onclick = function (e) {
            upload();
        }
    </script>
</body>
</html>